home *** CD-ROM | disk | FTP | other *** search
/ Aminet 12 / Aminet 12 (1996)(GTI - Schatztruhe)[!][Jun 1996].iso / Aminet / misc / edu / Calgor.lha / Cal / Algorithms / do_while.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-19  |  987 b   |  35 lines

  1. #include<hold/anim.h>
  2.  
  3. /* 000 */ void dowhile_control(void){
  4. /* 001 */ int guard = 3;
  5. /* 002 */ int count = 0;
  6.  
  7.           a_func("dowhile_control",0);
  8.           a_intini(guard,"guard",1);
  9.           a_intini(count,"count",2);
  10.           a_show(3);
  11. /* 003 */   do {
  12. /* 004 */      guard--;
  13.                a_intass("guard","guard-1",4);
  14. /* 005 */      count++;
  15.                a_intass("count","count+1",5);
  16.                a_intcomp("guard>0",6);
  17. /* 006 */   } while(guard>0);
  18.             a_show(7);
  19. /* 007 */   do {
  20. /* 008 */      guard++;
  21.                a_intass("guard","guard+1",8);
  22. /* 009 */      count--;
  23.                a_intass("count","count-1",9);
  24.                a_intcomp("guard<0",10);
  25. /* 010 */   } while(guard<0);
  26.             a_show(11);
  27. /* 011 */   do {
  28. /* 012 */      guard++;
  29.                a_intass("guard","guard+1",12);
  30. /* 013 */      count--;
  31.                a_intass("count","count-1",14);
  32.                a_intcomp("guard<3",14);
  33. /* 014 */   } while(guard<3);
  34. /* 015 */ }
  35.